package com.example.tao_city.text1;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.Time;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;


/**
 * Created by TAO_CITY on 2018/1/22.
 */

public class Nfcchenggong extends Activity {
    private ImageView back;
    private TextView yue;
    private TextView dangqianyue;
    private TextView kahao;
    private TextView shijian;
    private Button btn1,btn2;
    private Intent in;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.nfcchenggong);
        initview();
        setnumber();
    }

    private void initview() {
        back=findViewById(R.id.nfcchenggong_back);
        yue=findViewById(R.id.nfcchenggong_yue);
        dangqianyue=findViewById(R.id.nfcchenggong_dangqianyue);
        kahao=findViewById(R.id.nfcchenggong_kahao);
        shijian=findViewById(R.id.nfcchenggong_time);;
        btn1=findViewById(R.id.nfcchenggong_btn1);


        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
    private void setnumber(){
        in=getIntent();
        double x= Double.parseDouble(in.getStringExtra("chongqian"));
        double y= Double.parseDouble(in.getStringExtra("yue"));
        double m=x+y;
        String a=m+"";
        dangqianyue.setText(a+"元");
        yue.setText(in.getStringExtra("yue")+"元");
        kahao.setText(in.getStringExtra("kahao"));
        Time t=new Time();
        t.setToNow();
        int b=t.month+1;
        shijian.setText(t.year+"-"+b+"-"+t.monthDay+" "+t.hour+":"+t.minute+":"+t.second);

    }
}
